<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>CPU: D:/Users/MrSpeedStalker/Documents/Visual Studio 2013/doxygen_documentation/stack/stack.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">CPU
   &#160;<span id="projectnumber">0.5</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('stack_8h.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Macros</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle">
<div class="title">stack.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Header file that allows you to work with the stack.  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &lt;stdio.h&gt;</code><br/>
</div>
<p><a href="stack_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_stack__t.html">Stack_t</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates stack.  <a href="struct_stack__t.html#details">More...</a><br/></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:aeb5b888ed07af50a4d2c9c73a1c24644"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="stack_8h.html#aeb5b888ed07af50a4d2c9c73a1c24644">ASSERT_OK</a>(type)</td></tr>
<tr class="memdesc:aeb5b888ed07af50a4d2c9c73a1c24644"><td class="mdescLeft">&#160;</td><td class="mdescRight">Checks is <code>type</code> OK or not.  <a href="#aeb5b888ed07af50a4d2c9c73a1c24644">More...</a><br/></td></tr>
<tr class="separator:aeb5b888ed07af50a4d2c9c73a1c24644"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:a48ca3ff2cfe9aa2266d0fd50b0858a80"><td class="memItemLeft" align="right" valign="top">typedef double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="stack_8h.html#a48ca3ff2cfe9aa2266d0fd50b0858a80">elem_t</a></td></tr>
<tr class="memdesc:a48ca3ff2cfe9aa2266d0fd50b0858a80"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set type of elem_t.  <a href="#a48ca3ff2cfe9aa2266d0fd50b0858a80">More...</a><br/></td></tr>
<tr class="separator:a48ca3ff2cfe9aa2266d0fd50b0858a80"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a2680c8176f4c3bcb632c8a7ee795e025"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="stack_8h.html#a2680c8176f4c3bcb632c8a7ee795e025">Stack_construct</a> (<a class="el" href="struct_stack__t.html">Stack_t</a> *st)</td></tr>
<tr class="separator:a2680c8176f4c3bcb632c8a7ee795e025"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2a5c3977cb72d9ce7e4b49b832026816"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="stack_8h.html#a2a5c3977cb72d9ce7e4b49b832026816">Stack_destruct</a> (<a class="el" href="struct_stack__t.html">Stack_t</a> *st)</td></tr>
<tr class="separator:a2a5c3977cb72d9ce7e4b49b832026816"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6fb62b9edcfe4ef3cf46b6466072a802"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="stack_8h.html#a6fb62b9edcfe4ef3cf46b6466072a802">Stack_OK</a> (const <a class="el" href="struct_stack__t.html">Stack_t</a> *st)</td></tr>
<tr class="separator:a6fb62b9edcfe4ef3cf46b6466072a802"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a258cdf6aecf7344e732aa06082866ed4"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="stack_8h.html#a258cdf6aecf7344e732aa06082866ed4">Stack_dump</a> (const <a class="el" href="struct_stack__t.html">Stack_t</a> *st)</td></tr>
<tr class="separator:a258cdf6aecf7344e732aa06082866ed4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a19203e3d69f21e4f992d7c680256d54f"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="stack_8h.html#a19203e3d69f21e4f992d7c680256d54f">Stack_push</a> (<a class="el" href="struct_stack__t.html">Stack_t</a> *this_, <a class="el" href="stack_8h.html#a48ca3ff2cfe9aa2266d0fd50b0858a80">elem_t</a> val)</td></tr>
<tr class="separator:a19203e3d69f21e4f992d7c680256d54f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af3c3dd414683b2fb5b8811ba2a74460f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="stack_8h.html#a48ca3ff2cfe9aa2266d0fd50b0858a80">elem_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="stack_8h.html#af3c3dd414683b2fb5b8811ba2a74460f">Stack_pop</a> (<a class="el" href="struct_stack__t.html">Stack_t</a> *this_)</td></tr>
<tr class="separator:af3c3dd414683b2fb5b8811ba2a74460f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:accba6ae727ba87c702b3d71a73490793"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="stack_8h.html#accba6ae727ba87c702b3d71a73490793">Stack_sum</a> (<a class="el" href="struct_stack__t.html">Stack_t</a> *this_)</td></tr>
<tr class="separator:accba6ae727ba87c702b3d71a73490793"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9e27a8ac6d4dad23504fbef70075ea7b"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="stack_8h.html#a9e27a8ac6d4dad23504fbef70075ea7b">Stack_sub</a> (<a class="el" href="struct_stack__t.html">Stack_t</a> *this_)</td></tr>
<tr class="separator:a9e27a8ac6d4dad23504fbef70075ea7b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a33c627402b1c17b7704d361e6a80ae87"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="stack_8h.html#a33c627402b1c17b7704d361e6a80ae87">Stack_mul</a> (<a class="el" href="struct_stack__t.html">Stack_t</a> *this_)</td></tr>
<tr class="separator:a33c627402b1c17b7704d361e6a80ae87"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a12c127dc4a0c210168c0c619d0761a31"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="stack_8h.html#a12c127dc4a0c210168c0c619d0761a31">Stack_div</a> (<a class="el" href="struct_stack__t.html">Stack_t</a> *this_)</td></tr>
<tr class="separator:a12c127dc4a0c210168c0c619d0761a31"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:a88705c43ae20e7945746ddb110713ac4"><td class="memItemLeft" align="right" valign="top">const int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="stack_8h.html#a88705c43ae20e7945746ddb110713ac4">STK_SZ</a> = 10</td></tr>
<tr class="memdesc:a88705c43ae20e7945746ddb110713ac4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Stack size.  <a href="#a88705c43ae20e7945746ddb110713ac4">More...</a><br/></td></tr>
<tr class="separator:a88705c43ae20e7945746ddb110713ac4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3357c1bc55c7b533b5c56978983a0526"><td class="memItemLeft" align="right" valign="top">const int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="stack_8h.html#a3357c1bc55c7b533b5c56978983a0526">POISON</a> = -666</td></tr>
<tr class="memdesc:a3357c1bc55c7b533b5c56978983a0526"><td class="mdescLeft">&#160;</td><td class="mdescRight">Const that have very bad value (especially for stack counter...).  <a href="#a3357c1bc55c7b533b5c56978983a0526">More...</a><br/></td></tr>
<tr class="separator:a3357c1bc55c7b533b5c56978983a0526"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Header file that allows you to work with the stack. </p>
<dl class="section date"><dt>Date</dt><dd>2013-11-15 22:01:24 +0400 </dd></dl>
<dl class="section author"><dt>Author</dt><dd>Roman Anufriev <a href="#" onclick="location.href='mai'+'lto:'+'mrs'+'pe'+'eds'+'ta'+'lke'+'r@'+'gma'+'il'+'.co'+'m'; return false;">mrspe<span style="display: none;">.nosp@m.</span>edst<span style="display: none;">.nosp@m.</span>alker<span style="display: none;">.nosp@m.</span>@gma<span style="display: none;">.nosp@m.</span>il.co<span style="display: none;">.nosp@m.</span>m</a> <pre class="fragment">     It contains all necessary instruments to correctly work with the
     stack. Also it has some simple arithmetic functions.  </pre></dd></dl>
</div><h2 class="groupheader">Macro Definition Documentation</h2>
<a class="anchor" id="aeb5b888ed07af50a4d2c9c73a1c24644"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define ASSERT_OK</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">type</td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">if</span> (!type##_OK(this_))               \</div>
<div class="line">                            {                                \</div>
<div class="line">                            type##_dump(this_),              \</div>
<div class="line">                            assert (!<span class="stringliteral">&quot;not_OK -&gt; it is bad&quot;</span>); \</div>
<div class="line">                            }</div>
</div><!-- fragment -->
<p>Checks is <code>type</code> OK or not. </p>
<p>Quite complicated define that checks if <code>type</code> OK and if not calls:</p>
<ul>
<li>Function <code>"type"_OK</code></li>
<li>Function <code>"type"_dump</code></li>
<li>Assert that<ul>
<li>always wrong</li>
<li>writes <code>"not_OK -\&gt; it is bad"</code> </li>
</ul>
</li>
</ul>

</div>
</div>
<h2 class="groupheader">Typedef Documentation</h2>
<a class="anchor" id="a48ca3ff2cfe9aa2266d0fd50b0858a80"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef double <a class="el" href="stack_8h.html#a48ca3ff2cfe9aa2266d0fd50b0858a80">elem_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set type of elem_t. </p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a2680c8176f4c3bcb632c8a7ee795e025"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Stack_construct </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_stack__t.html">Stack_t</a> *&#160;</td>
          <td class="paramname"><em>st</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p><code>Stack_construct</code> - constructs good stack.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">*st</td><td>address of the stack.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Address of the constructed stack.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>If (st == NULL) function printf: "NULL pointer to the stack. The stack did not constructed.\n". </dd></dl>

</div>
</div>
<a class="anchor" id="a2a5c3977cb72d9ce7e4b49b832026816"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Stack_destruct </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_stack__t.html">Stack_t</a> *&#160;</td>
          <td class="paramname"><em>st</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p><code>Stack_destruct</code> - destructs the stack.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">*st</td><td>address of the stack.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Adress of destructed stack.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>If (st == NULL) function printf: "NULL pointer to the stack that is being destructed.\n". </dd>
<dd>
If function could destruct stack it printf: "The stack is successfully destructed.\n" </dd>
<dd>
if not: "The stack can not be destructed.\n". </dd></dl>

</div>
</div>
<a class="anchor" id="a12c127dc4a0c210168c0c619d0761a31"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Stack_div </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_stack__t.html">Stack_t</a> *&#160;</td>
          <td class="paramname"><em>this_</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p><code>Stack_div</code> - pops two elements from the top of the stack, divs them and push the result into the stack.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">*this_</td><td>address of the stack.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>1 function ended successfully, all is alright. </dd>
<dd>
0 number of elements in the stack are less than 2.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>function divides the DEEPER (the first after the top) placed number BY the TOP one. </dd></dl>

</div>
</div>
<a class="anchor" id="a258cdf6aecf7344e732aa06082866ed4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Stack_dump </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="struct_stack__t.html">Stack_t</a> *&#160;</td>
          <td class="paramname"><em>st</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p><code>Stack_dump</code> - do the comlete dump of the stack.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">*st</td><td>address of the stack.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>Dump includes:<ul>
<li>is stack OK or not</li>
<li>address of the beginning of the stack</li>
<li>content of the stack<ul>
<li>counter</li>
<li>stack size</li>
<li>each element of the stack<ul>
<li>used elements marked with '*'</li>
<li>elements that used to be used are likely have 'POISON' value. </li>
</ul>
</li>
</ul>
</li>
</ul>
</dd></dl>

</div>
</div>
<a class="anchor" id="a33c627402b1c17b7704d361e6a80ae87"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Stack_mul </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_stack__t.html">Stack_t</a> *&#160;</td>
          <td class="paramname"><em>this_</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p><code>Stack_mul</code> - pops two elements from the top of the stack, muls them and push the result into the stack.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">*this_</td><td>address of the stack.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>1 function ended successfully, all is alright. </dd>
<dd>
0 number of elements in the stack are less than 2. </dd></dl>

</div>
</div>
<a class="anchor" id="a6fb62b9edcfe4ef3cf46b6466072a802"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Stack_OK </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="struct_stack__t.html">Stack_t</a> *&#160;</td>
          <td class="paramname"><em>st</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p><code>Stack_OK</code> - checks is the stack OK or not.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">*st</td><td>address of the stack.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>1 if stack is OK. </dd>
<dd>
0 if not. </dd></dl>

</div>
</div>
<a class="anchor" id="af3c3dd414683b2fb5b8811ba2a74460f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="stack_8h.html#a48ca3ff2cfe9aa2266d0fd50b0858a80">elem_t</a> Stack_pop </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_stack__t.html">Stack_t</a> *&#160;</td>
          <td class="paramname"><em>this_</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p><code>Stack_pop</code> - pops element from the top of the stack.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">*this_</td><td>address of the stack.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>pop_val popped number</dd></dl>
<dl class="section note"><dt>Note</dt><dd>function prints "The stack is empty. You can not pop from an
                               empty stack.\n" if the stack is empty. </dd></dl>

</div>
</div>
<a class="anchor" id="a19203e3d69f21e4f992d7c680256d54f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Stack_push </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_stack__t.html">Stack_t</a> *&#160;</td>
          <td class="paramname"><em>this_</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="stack_8h.html#a48ca3ff2cfe9aa2266d0fd50b0858a80">elem_t</a>&#160;</td>
          <td class="paramname"><em>val</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p><code>Stack_push</code> - push 'elem_t' number in the stack.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">*this_</td><td>address of the stack. </td></tr>
    <tr><td class="paramname">val</td><td>element that should be pushed</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>1 element was successfully pushed, all is alright. </dd>
<dd>
0 stack is full, element could not be pushed. </dd></dl>

</div>
</div>
<a class="anchor" id="a9e27a8ac6d4dad23504fbef70075ea7b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Stack_sub </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_stack__t.html">Stack_t</a> *&#160;</td>
          <td class="paramname"><em>this_</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p><code>Stack_sub</code> - pops two elements from the top of the stack, subs them and push the result into the stack.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">*this_</td><td>address of the stack.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>1 function ended successfully, all is alright. </dd>
<dd>
0 number of elements in the stack are less than 2.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>function subtracts the TOP placed number FROM the DEEPER (the first after the top) one. </dd></dl>

</div>
</div>
<a class="anchor" id="accba6ae727ba87c702b3d71a73490793"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Stack_sum </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_stack__t.html">Stack_t</a> *&#160;</td>
          <td class="paramname"><em>this_</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p><code>Stack_sum</code> - pops two elements from the top of the stack, sums them and push the result into the stack.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">*this_</td><td>address of the stack.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>1 function ended successfully, all is alright. </dd>
<dd>
0 number of elements in the stack are less than 2. </dd></dl>

</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
<a class="anchor" id="a3357c1bc55c7b533b5c56978983a0526"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const int POISON = -666</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Const that have very bad value (especially for stack counter...). </p>

</div>
</div>
<a class="anchor" id="a88705c43ae20e7945746ddb110713ac4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const int STK_SZ = 10</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Stack size. </p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_275089585c7fc1b5fd5d7d42c69cb1da.html">D:</a></li><li class="navelem"><a class="el" href="dir_394ff8aee7398e78ab38baed8ef80807.html">Users</a></li><li class="navelem"><a class="el" href="dir_76c7a3f8ab961cf3780e55b1c3bdcd56.html">MrSpeedStalker</a></li><li class="navelem"><a class="el" href="dir_2ad460a22060d7cc6e4076945a384823.html">Documents</a></li><li class="navelem"><a class="el" href="dir_ccdd1547f554b825a421fbe2810319f3.html">Visual Studio 2013</a></li><li class="navelem"><a class="el" href="dir_3f308a43b414552e9efc154f6328e28e.html">doxygen_documentation</a></li><li class="navelem"><a class="el" href="dir_ccd32f398d102ce9b52a969e058d3a87.html">stack</a></li><li class="navelem"><a class="el" href="stack_8h.html">stack.h</a></li>
    <li class="footer">Generated on Fri Nov 15 2013 03:42:41 for CPU by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.5 </li>
  </ul>
</div>
</body>
</html>
